/* Structure for a bidirectional tableau pile */
typedef struct {
    int buildsuit;	/* One of the S_* values below */
    int movesuit;	/* Suit rule for moving stacks */
    int movestep;	/* Step for moving stacks - npip means no rule */
    int basecard;	/* Low pip value - if 0, we enable wrapping */
    int fillblank;	/* Can only fill blanks with kings? */
    int nobreak;	/* Don't break sequences when moving off */
    int beginset;	/* First column of this tableau set */
    int id;		/* ID number of stack with current contents */
} BiTableauStack;

#ifndef F_NONE

#define F_NONE 0
#define F_ANYTHING 1
#define F_KINGONLY 2
#define F_KINGLEFT 3	/* King only, or full stack from next column */

/* Deal Flip valeus */
#define FLIP_NONE 0
#define FLIP_ALL 1

#else
#define HAVE_TABLEAU 1
#endif

extern BiTableauStack *bitableau;

void makeBiTableau(int ndeal, int dealflip, Stack *deal,
	    int buildsuit, int basecard, int fillblank, int beginset);
void printBiTableau(FILE *f, Stack *stks);
void cleanBiTableau(void);
void gatherBiTableau(Stack *s, int rev);
int bitableau_firstMove(Stack *stack, int *index1, int *len);
int bitableau_nextMove(Stack *stack, int *index1, int *len);
int isfaceup(int dealflip, int i);
